import requests
import json
post_url = 'https://fanyi.baidu.com/sug'
while (1):
    word = input('输入你想查询的单词:\n')
    if (word != '0'):
        headers = {
            'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:34.0) Gecko/20100101 Firefox/34.0',
        }
        data = {
            'kw': word
        }
        response = requests.post(url=post_url, data=data, headers=headers)
        dic_obj = response.json()
        print(dic_obj['data'][0]['v'])
    else:
        break